<template>
  <div id="base-info" v-if="Object.keys(goods).length !== 0">
    <div class="info-title">{{goods.title}}</div>
    <div class="info-price">
      <span class="n-price">{{goods.price}}</span>
      <span class="o-price">{{goods.oldPrice}}</span>
      <span class="des">{{goods.discountDesc}}</span>
    </div>
    <div class="info-other">
      <span v-for="(item, index) in goods.columns" :key="index">{{item}}</span>
    </div>
    <div class="info-services">
      <span v-for="index in goods.services.length" :key="index" class="services-item">
        <img :src="goods.services[index - 1].icon" alt="">
        <span>{{goods.services[index - 1].name}}</span>
      </span>
    </div>
  </div>
</template>

<script>
  export default {
    name: "DetailBaseInfo",
    props:{
      goods:{
        type:Object,
        default (){
          return {}
        }
      }
    },
  }
</script>

<style scoped>
  #base-info{
    padding: 10px;
    color: #999 ;
    border-bottom: 5px solid #f2f5f8;
  }
  .info-title{
    color: #222;
    font-size: 16px;
  }
  .info-price{
    margin-top: 10px;
  }
  .info-price .n-price{
    font-size: 24px;
    color: var(--color-high-text);
  }
  .info-price .o-price{
    font-size: 13px;
    text-decoration: line-through;
    margin: 0 13px;
  }
  .info-price .des{
    font-size: 13px;
    border-radius: 8px;
    padding: 2px 5px;
    background-color:var(--color-high-text) ;
    color: #fff;
    position: relative;
    top: -8px;
  }
  .info-other{
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-top: 5px;
    line-height: 30px;
    border-bottom: 1px solid rgba(100,100,100,.1);
  }
  .info-services{
    display: flex;
    font-size: 13px;
    color: #333;
    line-height: 60px;
    justify-content: space-between;
  }
  .services-item img{
    width: 14px;
    height: 14px;
    position: relative;
    top: 2px;
  }
</style>